package zy.data.food.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import zy.data.food.domain.OrderMaster;
import zy.data.food.repository.OrderMasterRepository;

import java.util.List;

@RestController
public class hicontroller {

    @Autowired
    private OrderMasterRepository orderMasterRepository;

    @GetMapping(value = "/food")
    public String getToString(){
        return "Hi,Food!";
    }

    @GetMapping(value = "/all")
    public List<OrderMaster> getList2(){
        return orderMasterRepository.findAll();
    }
}
